home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / GWMALLOC.ZIP;1 / GWMALLOC.TAR / gw_malloc / TTD < prev    next >
Encoding:
Text File  |  1993-04-08  |  5.0 KB  |  114 lines

  1. -------------------------------------------------------------------------------
  2. $Id: TTD,v 1.19 1993/04/05 01:28:49 gray Exp $
  3. -------------------------------------------------------------------------------
  4.  
  5. IMPORTANT:
  6.  
  7. - add special-blocks with a sorted-free list
  8.     - over X bits then it becomes special
  9.     - if in free special and someone matches then drop the rest of
  10.         the allocation into a free list maybe, maybe-not
  11. - be able to break up bigger blocks of memory into small ones
  12.     - have a split(x) which asks for x+1 bits and then splits it into
  13.         2 blocks of x bits
  14.     - split then might go recursive
  15.     - maybe have a level X and only jump up a maximum of X bits to find
  16.         free space (depending on how much you want to fragment)
  17. - change the large block allocation process:
  18.     - needs to be a lot cleaner and produce a denser heap
  19.  
  20. -------------------------------------------------------------------------------
  21.  
  22. CHECKING:
  23.  
  24. - check in heap_check the cleared space above each allocation instead of
  25.     only the fence posts
  26. - maybe write the address % 256 into bytes instead of a constant
  27.     - maybe it would slow it down.
  28.     - a token/option?
  29.     - \305 is recognizable however
  30. - another token to have the library never reclaim memory, always extend the
  31.     heap (i.e. don't use free lists at all)
  32.     - this would grow into an enormous heap however.
  33. - maybe add another debug level which stores crc information about internal
  34.     heap structures and verifies it during run time.  slow, slow!!
  35.  
  36. -------------------------------------------------------------------------------
  37.  
  38. STRING SUPPORT:
  39.  
  40. - have special macros for string allocation for string functions.  possibly
  41.     uppercase or normal overrides.
  42. - maybe build in most string functions (strcat, strcpy, etc)
  43. - have a checking level/value that runs though the strings and makes sure
  44.     they have a NULL in them.
  45. - this may not be too important in the face of the bounds checking stuff but
  46.     it may report errors more intelligently
  47. - need to think if more support for strings would be a good thing
  48. - it would be able to locate common errors with strings a lot closer to the
  49.     actual problem.
  50. - inform the user to include the string stuff at the end of include list
  51.  
  52. -------------------------------------------------------------------------------
  53.  
  54. GENERAL:
  55.  
  56. - for fence underflow, print out the allocation below and for fence overflow
  57.     the allocation above if possible
  58. - maybe expand_string dump the first X bytes of an allocation per a token
  59. - add __builtin_return_value support for higher gcc versions (2.2.0+)
  60. - have either a bunch of free or used bblocks be:
  61.     - start block and then a set of continuation blocks
  62.     - this would mean we do not have to hit each bblock entry to redo
  63.         the type flag
  64. - handle memalign, valloc, maybe some form of mallopt
  65. - maybe use getpagesize (mach_dep.c) to determine BASIC block size
  66. - handle 0 length allocations correctly if the #define is set
  67.     - i.e. maybe give back a small section with bounds-checking touching
  68. - manage dblock_admin entries better
  69.     - map out usage and get some stats
  70.     - add to normal db_free lists, zero out each of the entries.  if they
  71.         are both zero or some magic X then we need to get more bblock
  72.         space for the dblocks.
  73. - special case last bunch of bblocks:
  74.     - have a pointer to the last contiguous set
  75.     - have them not in a free list
  76.     - if used and reallocs then just extend it
  77.     - if free and need some of it then extend (or not) and give
  78.     - maybe not worth it for 1 pointer
  79. - maybe make malloc_dbg use no stdio so no unwanted memory allocations.
  80. - turn realloc into an intelligent beasty that looks on either side
  81.     of existing chunk (if expanding) for free space and manages free-lists
  82.     appropriately
  83.  
  84. -------------------------------------------------------------------------------
  85.  
  86. TESTING / STATISTICS:
  87.  
  88. - need to write a set of fully automated test programs
  89.     - maybe start with a test shell like malloc_t but stripped and then
  90.         run a script through it and analyse the output
  91.     - should be a killer that does a million hits
  92. - test define for allowing 0 length defines
  93. - test define for realloc(NULL)
  94. - check out situation where sbrk calls return ERROR (from the beginning and
  95.     in the middle).  the library should return NULL's straight off and
  96.     log appropriate errors.
  97. - add free-list statistics whenever it gets more memory to see the viability of
  98.     dividing larger free entries in two
  99. - add statistics whenever it frees memory to see the viability of combining
  100.     adjacent blocks
  101. - maybe a program that would try a standard set of tests on a number of
  102.     different combinations of debug-values to look for dependancies.
  103.  
  104. -------------------------------------------------------------------------------
  105.  
  106. RMS comments:
  107.     - integrate into gnu-malloc
  108.     - change the bit-flags into the functionality strings themselves
  109.     - get rid of the malloc_dbg program and the mallocrc file (too "hairy")
  110.     - integrate __builtin_return_address functionality from gcc
  111.         gdb command 'info line *ADDRESS' to get file/line
  112.  
  113. -------------------------------------------------------------------------------
  114.